home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
C/C++ Users Group Library 1996 July
/
C-C++ Users Group Library July 1996.iso
/
listings
/
v_10_12
/
1012018b
< prev
next >
Wrap
Text File
|
1992-10-05
|
314b
|
18 lines
/* strrchr function */
#include <string.h>
char *(strrchr)(const char *s, int c)
{ /* find last occurrence of c in char s[] */
const char ch = c;
const char *sc;
for (sc = NULL; ; ++s)
{ /* check another char */
if (*s == ch)
sc = s;
if (*s == '\0')
return ((char *)sc);
}
}